]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
sessionMode: Drop allowExtensions property
authorRay Strode <rstrode@redhat.com>
Tue, 28 Sep 2021 19:31:11 +0000 (15:31 -0400)
committerMarge Bot <marge-bot@gnome.org>
Thu, 14 Oct 2021 18:40:53 +0000 (18:40 +0000)
Now that we allow extensions at the lock screens, extensions
are allowed for every session mode gnome-shell would typically
change to at runtime.

This means there's little advantage to having an allowExtensions
property in the session mode definition.

This commit simplifies the code a bit by dropping the property.

Third party session modes can still lock down extensions through
gsettings if they need to.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/1967>

js/ui/extensionSystem.js
js/ui/sessionMode.js

index 860f5fbc343c8988cdd29b18dd4239facfeb3728..ffa3cf38d3faebcf1cc0b2674d82228004ac23b4 100644 (file)
@@ -88,16 +88,6 @@ var ExtensionManager = class {
         return false;
     }
 
-    _sessionModeCanUseExtension(uuid) {
-        if (!Main.sessionMode.allowExtensions)
-            return false;
-
-        if (!this._extensionSupportsSessionMode(uuid))
-            return false;
-
-        return true;
-    }
-
     _callExtensionDisable(uuid) {
         let extension = this.lookup(uuid);
         if (!extension)
@@ -157,7 +147,7 @@ var ExtensionManager = class {
     }
 
     _callExtensionEnable(uuid) {
-        if (!this._sessionModeCanUseExtension(uuid))
+        if (!this._extensionSupportsSessionMode(uuid))
             return;
 
         let extension = this.lookup(uuid);
@@ -424,7 +414,7 @@ var ExtensionManager = class {
     }
 
     _callExtensionInit(uuid) {
-        if (!this._sessionModeCanUseExtension(uuid))
+        if (!this._extensionSupportsSessionMode(uuid))
             return false;
 
         let extension = this.lookup(uuid);
@@ -635,17 +625,9 @@ var ExtensionManager = class {
     }
 
     _sessionUpdated() {
-        // For now sessionMode.allowExtensions controls extensions from both the
-        // 'enabled-extensions' preference and the sessionMode.enabledExtensions
-        // property; it might make sense to make enabledExtensions independent
-        // from allowExtensions in the future
-        if (Main.sessionMode.allowExtensions) {
-            // Take care of added or removed sessionMode extensions
-            this._onEnabledExtensionsChanged();
-            this._enableAllExtensions();
-        } else {
-            this._disableAllExtensions();
-        }
+        // Take care of added or removed sessionMode extensions
+        this._onEnabledExtensionsChanged();
+        this._enableAllExtensions();
     }
 };
 Signals.addSignalMethods(ExtensionManager.prototype);
index 7629a509b572355a6196220b717bde867761a622..92d91fc604f7eb14c1373b3545d80c2c37791621 100644 (file)
@@ -20,7 +20,6 @@ const _modes = {
         showCalendarEvents: false,
         showWelcomeDialog: false,
         allowSettings: false,
-        allowExtensions: false,
         allowScreencast: false,
         enabledExtensions: [],
         hasRunDialog: false,
@@ -42,7 +41,6 @@ const _modes = {
     },
 
     'gdm': {
-        allowExtensions: true,
         hasNotifications: true,
         isGreeter: true,
         isPrimary: true,
@@ -59,7 +57,6 @@ const _modes = {
     },
 
     'unlock-dialog': {
-        allowExtensions: true,
         isLocked: true,
         unlockDialog: undefined,
         components: ['polkitAgent', 'telepathyClient'],
@@ -76,7 +73,6 @@ const _modes = {
         showCalendarEvents: true,
         showWelcomeDialog: true,
         allowSettings: true,
-        allowExtensions: true,
         allowScreencast: true,
         hasRunDialog: true,
         hasWorkspaces: true,